the script Interaction_Model_A.m runs the scripts that generate the tables for the ego-level model with interactions A as described in detail in section S2.6 and S3.4 of the Supplementary Materials. 

Interaction Model A:
We examine how a more or less active peer (compared to ego�s running activity) affects ego's running and vice versa.
To do that we first calculate the fraction (LAMBDA) between each peer's average running activity over the ego's average running activity and we separate the peers into groups depending on this fraction. We consider 9 groups depending on the range of that fraction: LAMBDA=(-inf,1/16],(1/16,1/8],(1/8,1/4],(1/4,1/2],(1/2,2],(2,4],(4,8],(8,16],(16,inf].
For each Ego i, we then split her/his neighborhood (peers j = 1:kit) into subsets depending of the value of LAMBDA we calculate the average running activity of this subset.



input data files: 	run_mat.mat
	     		distance_mat.mat
	     		duration_mat.mat
	    		pace_mat.mat
			TimeZone_mat.mat
			StartTime_mat.mat 
	   	        PRECIPITATION_mat.mat
             		TMAX_mat.mat
	     		USERREL_USEDFOR_SOCIAL_INFLUENCE_wth_correlations.mat
	     		App_Users_in_Graph_demographics.csv

output data file:      Interaction_model_A.txt (only headers-redacted for legal reasons)



the matlab script Interaction_Model_B.m runs the code that generates the tables for the ego-level model with interactions B as described in detail in section S2.6 and S3.4 of the Supplementary Materials. 

Interaction Model B:
How individuals with different levels of activity influence each other. We examine how two very active friends (or mostly inactive friends) influence each other. To do that we first separate all individuals into two categories, active (H) and inactive (L) by comparing their total running activity over the period of observation to the average running activity of all users. For each Ego i, we then split her/his neighborhood (peers j = 1:kit) into active (H) and inactive (L) and we calculate the average running activity of this subset. We consider 4 different scenarios: Ego active (H)- friend active (H), Ego active (H)- friend inactive (L), Ego inactive (L)- friend active (H), Ego inactive (L)- friend inactive (L).

input data files: 	run_mat.mat
	     		distance_mat.mat
	     		duration_mat.mat
	    		pace_mat.mat
			TimeZone_mat.mat
			StartTime_mat.mat 
	   	        PRECIPITATION_mat.mat
             		TMAX_mat.mat
	     		USERREL_USEDFOR_SOCIAL_INFLUENCE_wth_correlations.mat
	     		App_Users_in_Graph_demographics.csv

output data file:       Interaction_model_B.txt (only headers-redacted for legal reasons)




the Matlab script Interaction_Model_C.m runs the scripts that generate the tables for the ego-level model with interactions C as described in detail in section S2.6 and S3.4 of the Supplementary Materials. 


Interaction Model C: we are interested to identify how stickiness with exercise affects exercise influence. For each Ego i we split their neighborhood (peers j = 1:kit) into consistent and inconsistent and we calculate the average running activity of each subset.
we consider 4 different cases: ego consistent - friend consistent, ego consistent - friend inconsistent, ego inconsistent - friend consistent, ego inconsistent - friend inconsistent.

input data files: 	run_mat.mat
	     		distance_mat.mat
	     		duration_mat.mat
	    		pace_mat.mat
			TimeZone_mat.mat
			StartTime_mat.mat 
	   	        PRECIPITATION_mat.mat
             		TMAX_mat.mat
	     		USERREL_USEDFOR_SOCIAL_INFLUENCE_wth_correlations.mat
	     		App_Users_in_Graph_demographics.csv

output data files:      Interaction_model_C.txt (only headers-redacted for legal reasons)






the Matlab script Interaction_Model_D.m runs the code that generates the tables for the ego-level model with interactions D as described in detail in section S2.6 and S3.4 of the Supplementary Materials. 


Interaction Model D:
we are interested to identify how gender affects exercise influence. For each Ego i we split their neighborhood (peers j = 1:kit) into males and females and we calculate the average running activity of each subset. We consider 4 different cases: ego male - friend male, ego male - friend female, ego female - friend male, ego female - friend female.

input data files: 	run_mat.mat
	     		distance_mat.mat
	     		duration_mat.mat
	    		pace_mat.mat
			TimeZone_mat.mat
			StartTime_mat.mat 
	   	        PRECIPITATION_mat.mat
             		TMAX_mat.mat
	     		USERREL_USEDFOR_SOCIAL_INFLUENCE_wth_correlations.mat
	     		App_Users_in_Graph_demographics.csv

output data file:       Interaction_model_D.txt (only headers-redacted for legal reasons)




the STATA script interactions.do replicates the results presented in tables S8-S11 in supplementary materials and in Figure 3 of the main manuscript.

input data files: Interaction_model_A.txt (only headers-redacted for legal reasons)
		  Interaction_model_B.txt (only headers-redacted for legal reasons)
		  Interaction_model_C.txt (only headers-redacted for legal reasons)
		  Interaction_model_D.txt (only headers-redacted for legal reasons)







